package com.gitee.huanminabc.utils_test.service;

import com.gitee.huanminabc.utils_test.dal.dao.TUserDatasourceManager;
import com.gitee.huanminabc.dynamicdb.aop.DBTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserDatasourceService {
    @Autowired
    private TUserDatasourceManager tUserDatasourceManager;


    //多数据源事务嵌套内置的事务
    @DBTransactional
    public void updateByTran() {
        //这个是默认的数据源,里面有事务
        tUserDatasourceManager.updateByTran();
        tUserDatasourceManager.updateByTran();
        System.out.println();
    }



}
